<?php
include('../includes/modules/database/connect.php');
include('../includes/modules/database/function_sanpham.php');
$idChungLoai=$_GET['idCL'];
//var_dump($idChungLoai);exit();

$tenSanPham=$_POST['tenSanPham'];
//var_dump($tenSanPham);exit();
$moTa=$_POST['moTa'];
//var_dump($moTa);exit();
$gia=$_POST['gia'];
//var_dump($gia);exit();

$urlHinh=$_POST['urlHinh'];
//var_dump($urlHinh);exit();

$soLanXem=$_POST['soLanXem'];
//var_dump($soLanXem);exit();

$soLuongTonKho=$_POST['soLuongTonKho'];
//var_dump($soLuongTonKho);exit();

$ghiChu=$_POST['ghiChu'];
//var_dump($ghiChu);exit();

$soLanMua=$_POST['soLanMua'];
//var_dump($soLanMua);exit();

$anHien=$_POST['anHien'];
//var_dump($anHien);exit();

$ngayCapNhat=time();
//var_dump($ngayCapNhat);exit();

$themSanPham=themSanPham($idChungLoai,$tenSanPham,$moTa,$gia,$urlHinh,$soLanXem,$soLuongTonKho,$ghiChu,$soLanMua,$anHien,$ngayCapNhat);
if($themSanPham==true)
{
	header('location: show_sanpham.php');
}
else{
	echo 'error!!!';
}
?>